Skip to content

[Backport 4.0.x][#12353] Add jaxb2-maven-plugin to mvnup plugin upgrade list#12356

Open
gnodet wants to merge 1 commit into
apache:maven-4.0.xfrom
gnodet:backport-12353-to-4.0.x
Open

[Backport 4.0.x][#12353] Add jaxb2-maven-plugin to mvnup plugin upgrade list#12356
gnodet wants to merge 1 commit into
apache:maven-4.0.xfrom
gnodet:backport-12353-to-4.0.x

Conversation

@gnodet

@gnodet gnodet commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of #12354 to maven-4.0.x.

  • Add jaxb2-maven-plugin (min version 3.2.0) to the mvnup plugin upgrade list
  • jaxb2-maven-plugin versions before 3.2.0 depend on jaxb-parent:3.0.0 which contains <Xlint:all /> — an element with an undeclared namespace prefix that Maven 4's namespace-aware StAX parser rejects
  • This causes transitive dependencies (jaxb-core, jaxb-impl) to be lost from the plugin classrealm, resulting in ClassNotFoundException at runtime
  • jaxb-parent:3.0.2 (used by jaxb2-maven-plugin 3.2.0+) fixed the invalid XML upstream

Test plan

  • Added unit test verifying jaxb2-maven-plugin 3.1.0 gets upgraded to 3.2.0
  • All PluginUpgradeStrategyTest tests pass on maven-4.0.x
  • Verified end-to-end: jaxb2-maven-plugin:3.1.0 fails on Maven 4, 3.2.0 succeeds

Closes #12353

🤖 Generated with Claude Code

jaxb2-maven-plugin versions before 3.2.0 depend on jaxb-parent:3.0.0
which contains `<Xlint:all />` — an element with an undeclared namespace
prefix. Maven 4's namespace-aware StAX parser rejects this invalid XML,
causing transitive dependencies (jaxb-core, jaxb-impl) to be lost from
the plugin classrealm, resulting in ClassNotFoundException at runtime.

jaxb-parent:3.0.2 (used by jaxb2-maven-plugin 3.2.0+) fixed this by
using `<compilerArgument>-Xlint:all</compilerArgument>` instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet added this to the 4.0.0-rc-6 milestone Jun 23, 2026
@gnodet gnodet added enhancement New feature or request mvn40 backport labels Jun 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Backports the mvnup plugin upgrade strategy update to Maven 4.0.x to automatically bump org.codehaus.mojo:jaxb2-maven-plugin to a Maven 4–compatible minimum version, preventing failures caused by invalid XML in older transitive POMs.

Changes:

  • Added org.codehaus.mojo:jaxb2-maven-plugin with minimum version 3.2.0 to the mvnup plugin upgrade list.
  • Added a unit test ensuring jaxb2-maven-plugin 3.1.0 is upgraded to 3.2.0.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnup/goals/PluginUpgradeStrategy.java Adds jaxb2-maven-plugin (min 3.2.0) to the plugin upgrade map/list so mvnup upgrades incompatible versions.
impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvnup/goals/PluginUpgradeStrategyTest.java Adds coverage verifying mvnup upgrades jaxb2-maven-plugin from 3.1.0 to 3.2.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport enhancement New feature or request mvn40

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants